<!DOCTYPE html>
<html lang="zh">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <!-- transition -->
    <!-- 此属性是 transition-property 属性、transition-duration持续时间、transition-timing-function速度曲线、transition-delay延迟 的简写形式。 -->

    <div class="box" style="margin-top: 200px">box</div>
    <hr />
    <div class="box box1">box</div>
    <style>
      .box {
        width: 100px;
        height: 100px;
        background-color: lightblue;

        /* transition: all 1s ; */
        /* 复合属性 */

        /* transition-property: all; */
        /* all 所有的属性（有变化的 有变化才会有动画） */
        transition-property: margin-left;

        transition-timing-function: linear;
        /* linear 匀速运动 */

        transition-duration: 5s;
        /* transition-delay: 3s; */
      }

      .box1 {
        /* transition-timing-function: ease; */
        /* transition-timing-function: ease-in; */
        /* transition-timing-function: ease-out; */
        /* transition-timing-function: ease-in-out; */

        transition-timing-function: cubic-bezier(0.12, 0.49, 0.45, 0.87);
      }

      body:hover .box {
        margin-left: 500px;
        background-color: lightcoral;
      }
    </style>

    <div class="boxA">boxA</div>
    <style>
      .boxA {
        width: 100px;
        height: 100px;
        background-color: lightblue;
        transition: all 1s;
      }
      body:hover .boxA {
        transition: all 0s;
        margin-left: 200px;
      }
    </style>
  </body>
</html>
